<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8" />
    <title></title>
    <link href="../../assets/lib/layui/css/layui.css" rel="stylesheet" />
    <link href="../../assets/lib/winui/css/winui.css" rel="stylesheet" />
</head>

<body style="background-color: RGB(242, 242, 242);">
    <div class="fileconsole-mask">
        <div class="cent">
            <i class="fa fa-spin fa-spinner fa-fw"></i><br><br>
            <font>加载中</font>
        </div>
    </div>

    <div class="forum-console">
        <div class="forum-title" id="forumTitle">

        </div>
        <div class="forum-search">
            <input type="text" id="iconClass" name="iconClass" placeholder="搜索论坛帖" class="layui-input">
            <button class="layui-btn layui-btn-primary layui-btn-sm" id="forumSearch" title="搜索"><i
                    class="fa fa-search fa-fw"></i></button>
        </div>
        <div class="main-content layui-row layui-col-space10">
            <div class="main-content-one layui-col-md9 layui-col-space10 layui-card layui-hide">
                <div class="layadmin-caller">
                    <div class="layui-tab layui-tab-brief caller-tab" lay-filter="docDemoTabBrief">
                        <ul class="layui-tab-title">
                            <li class="layui-this">搜索出的贴子</li>
                        </ul>
                    </div>
                    <div class="caller-contar">
                        <div class="layui-col-xs12 row-model" id="searchForumList">

                        </div>
                    </div>
                </div>
                <!-- searchForumListTemplate.tpl -->
                <script type="text/x-handlebars-template" id="searchForumListTemplate">
				{{#each rows}}
					<div class="caller-item">
						<div class="my-forum-main caller-fl" rowId='{{id}}'>
                            <p><em>{{forumTitle}}</em></p>
                            <p class="search-forum-desc"><em></em></p>
						</div>
					</div>
				{{/each}}
				</script>
            </div>
            <div class="main-content-two layui-col-md9 layui-col-space10">
                <div class="layui-col-md12">
                    <div class="layui-card">
                        <div class="layui-card-header">热门
                            <a href="../../tpl/forumshow/forumtaglist.html?id=hot" class="layui-a-tips">全部热门</a>
                        </div>
                        <div class="layui-card-body">
                            <div class="layui-row layui-col-space10" id="hotForumList">
                                <!-- hotForumListTemplate.tpl -->
                                <script type="text/x-handlebars-template" id="hotForumListTemplate">
								{{#each rows}}
									<div class="layui-col-xs12 layui-col-sm4">
										<div class="layuiadmin-card-text" rowid="{{id}}">
											<div class="layui-text-top">
												<img userId="{{userId}}" class="hot-user-img" alt="" src="{{createMation.userPhoto}}">
												<a class="forum-invitation">{{forumTitle}}</a>
											</div>
											<p class="layui-text-bottom">
												<a class="layui-text-bottom-b"></a><span>{{createTime}}</span>
                                            </p>
										</div>
									</div>
								{{/each}}
								</script>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="layui-col-md6">
                    <div class="layui-card">
                        <div class="layui-card-header">最新贴</div>
                        <div class="layui-card-body">
                            <div class="posts-scroll-container">
                                <dl class="layuiadmin-card-status" id="newForumList">
                                    <!-- newForumListTemplate.tpl -->
                                    <script type="text/x-handlebars-template" id="newForumListTemplate">
									{{#each rows}}
										<div class="comment-item">
											<div class="comment-user">
												<img src="{{createMation.userPhoto}}" class="user-avatar">
												<div class="comment-info">
													<div class="user-name">{{createMation.userName}}</div>
													<div class="comment-time">{{createTime}}</div>
												</div>
											</div>
											<div class="comment-content">
												<p  rowid="{{id}}">{{forumTitle}}</p>
                                                <span class="forum-stats">
                                                    <i class="fa fa-eye"></i> {{browseNum}}
                                                    <i class="fa fa-comment-o"></i> {{commentNum}}
                                                </span>
											</div>
										</div>
									{{/each}}
									</script>
                                </dl>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="layui-col-md6">
                    <div class="layui-card">
                        <div class="layui-card-header">最新评论</div>
                        <div class="layui-card-body">
                            <div class="comments-scroll-container">
                                <div id="newCommentList">
                                    <!-- 评论列表将在这里显示 -->
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

            </div>

            <div class="layui-col-md3 layui-col-space10">
                <div class="layui-col-md12">
                    <div class="layui-card">
                        <div class="layui-card-header">活跃用户</div>
                        <div class="layui-card-body">
                            <ul class="layui-row layui-col-space10 active-user" id="activeUsersList">
                                <!-- activeUsersListTemplate.tpl -->
                                <script type="text/x-handlebars-template" id="activeUsersListTemplate">
								{{#each rows}}
									<li class="layui-col-xs3">
										<a class="forum-active-user" userId='{{userMation.id}}'>
											<div class="user-avatar-wrap">
												<img class="active-user-img" alt="{{userMation.userName}}" src="{{userMation.userPhoto}}">
											</div>
											<div class="user-info">
												<cite>{{userMation.userName}}</cite>
												<p class="user-dept">{{userMation.departmentName}}</p>
											</div>
										</a>
									</li>
								{{/each}}
								</script>
                            </ul>
                        </div>
                    </div>
                </div>

                <div class="layui-col-md12">
                    <div class="layui-card">
                        <div class="layui-card-header">热门标签</div>
                        <div class="layui-card-body">
                            <div class="layuiadmin-card-link" id="hotTagList">
                                <!-- hotTagListTemplate.tpl -->
                                <script type="text/x-handlebars-template" id="hotTagListTemplate">
									{{#each rows}}
										<a href="javascript:;" rowid='{{id}}'>{{forumTag.tagName}}</a>
									{{/each}}
								</script>
                            </div>
                        </div>
                    </div>
                </div>

            </div>
        </div>
    </div>

    <script src="../../assets/lib/layui/layui.js"></script>
    <script src="../../assets/lib/layui/custom.js"></script>
    <script type="text/javascript">
        layui.config({ base: '../../js/forumshow/' }).use('forumlist');
    </script>

    <!-- 最新评论模板 -->
    <script type="text/x-handlebars-template" id="commentTemplate">
    {{#each rows}}
        <div class="comment-item">
            <div class="comment-user">
                <img src="{{createMation.userPhoto}}" class="user-avatar">
                <div class="comment-info">
                    <div class="user-name">{{createMation.userName}}</div>
                    <div class="comment-time">{{createTime}}</div>
                </div>
            </div>
            <div class="comment-content">
                <div class="forum-link">
                    <i class="fa fa-comment-o"></i>
                    {{#if forumId}}
                    <a href="../../tpl/forumshow/forumitem.html?id={{forumId}}">{{content}}</a>
                    {{else}}
                    {{/if}}
                </div>
            </div>
        </div>
    {{/each}}
    </script>

    <style>
        /* 最新帖子和评论共用样式 */
        .comment-item {
            padding: 15px 0;
            border-bottom: 1px solid #f0f0f0;
        }

        .comment-item:last-child {
            border-bottom: none;
        }

        .comment-user {
            display: flex;
            align-items: flex-start;
            margin-bottom: 8px;
        }

        .user-avatar {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            margin-right: 12px;
            border: 1px solid #eee;
        }

        .comment-info {
            flex: 1;
        }

        .user-name {
            font-size: 14px;
            font-weight: 500;
            color: #333;
            line-height: 1.2;
            margin-bottom: 2px;
        }

        .comment-time {
            font-size: 12px;
            color: #999;
        }

        .comment-content {
            margin-left: 44px;
        }

        .forum-title {
            font-size: 14px;
            color: #1890ff;
            margin-bottom: 8px;
            cursor: pointer;
        }

        .forum-title:hover {
            color: #40a9ff;
            text-decoration: underline;
        }

        .comment-text {
            color: #666;
            font-size: 13px;
            line-height: 1.5;
            margin-bottom: 8px;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 2;
        }

        .forum-link {
            display: flex;
            align-items: center;
            font-size: 12px;
        }

        .forum-stats {
            color: #999;
        }

        .forum-stats i {
            margin: 0 4px 0 12px;
        }

        .forum-stats i:first-child {
            margin-left: 0;
        }

        /* 活跃用户样式 */
        .layui-col-ls3 {
            padding: 8px;
        }

        .forum-active-user {
            display: block;
            text-decoration: none;
            padding: 12px 8px;
            border-radius: 6px;
            transition: all 0.2s ease;
        }

        .forum-active-user:hover {
            background-color: #f7f7f7;
            transform: translateY(-2px);
        }

        .user-avatar-wrap {
            position: relative;
            width: 54px;
            height: 54px;
            margin: 0 auto 10px;
        }

        .active-user-img {
            width: 100%;
            height: 100%;
            border-radius: 50%;
            border: 2px solid #fff;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
            transition: all 0.3s ease;
        }

        .forum-active-user:hover .active-user-img {
            transform: scale(1.05);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        }

        .user-info {
            text-align: center;
        }

        .user-info cite {
            display: block;
            font-size: 14px;
            color: #333;
            font-weight: 500;
            margin-bottom: 4px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .user-info .user-dept {
            font-size: 12px;
            color: #999;
            margin: 0;
            line-height: 1.4;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        /* 卡片样式优化 */
        .layui-card {
            margin-bottom: 15px;
            box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
        }

        .layui-card-header {
            height: 50px;
            line-height: 50px;
            padding: 0 15px;
            border-bottom: 1px solid #f0f0f0;
        }

        .layui-card-body {
            padding: 5px;
        }

        /* 最新贴滚动容器 */
        .posts-scroll-container {
            max-height: 400px;
            overflow-y: auto;
            padding-right: 5px;
        }

        /* 自定义滚动条样式 */
        .posts-scroll-container::-webkit-scrollbar {
            width: 6px;
        }

        .posts-scroll-container::-webkit-scrollbar-track {
            background: #f1f1f1;
            border-radius: 3px;
        }

        .posts-scroll-container::-webkit-scrollbar-thumb {
            background: #ddd;
            border-radius: 3px;
        }

        .posts-scroll-container::-webkit-scrollbar-thumb:hover {
            background: #999;
        }

        /* 确保内部元素显示正常 */
        .posts-scroll-container .comment-item:last-child {
            margin-bottom: 5px;
        }

        /* 最新评论滚动容器 */
        .comments-scroll-container {
            max-height: 400px;
            overflow-y: auto;
            padding-right: 5px;
        }

        /* 确保评论滚动容器使用与帖子滚动容器相同的滚动条样式 */
        .comments-scroll-container::-webkit-scrollbar {
            width: 6px;
        }

        .comments-scroll-container::-webkit-scrollbar-track {
            background: #f1f1f1;
            border-radius: 3px;
        }

        .comments-scroll-container::-webkit-scrollbar-thumb {
            background: #ddd;
            border-radius: 3px;
        }

        .comments-scroll-container::-webkit-scrollbar-thumb:hover {
            background: #999;
        }

        /* 确保最后一条评论底部有适当的间距 */
        .comments-scroll-container .comment-item:last-child {
            margin-bottom: 5px;
        }
    </style>
</body>

</html>